<template>
    <view>
        <view class="notics">
            <view class="listdata" v-for="(item,index) in noticArr" :key="index">
                <navigator :url="'../noticdetail/noticdetail?id='+item.id">
                    <view class="conents">
                        <view class="saymng">{{item.title}}</view>
                        <view class="dates">
                            {{item.createdTime}}
                        </view>
                    </view>
                    <image class="nocimg" :src="item.url"></image>
                </navigator>
            </view>
        </view>
    </view>
</template>

<script>
    let uinfo;
    import request from "../../untils/request.js";
    export default {
        data() {
            return {
                noticArr: []
            }
        },
        onLoad() {
            this.noticfn();
        },
        onPullDownRefresh() {
            console.log('refresh');
            
            this.noticfn();
        },
        methods: {
            noticfn() {
                request.postMember('/user/commoninfo/queryCommonInfo', {
                    type: '3',
                }).then(res => {
                    if (res.code == '200') {
                        uni.stopPullDownRefresh();
                        this.noticArr = res.data.infos;
                    }else{
                        uni.stopPullDownRefresh();
                        uni.showToast({
                            icon: "none",
                            title: res.message,
                        });
                    }
                })
            }
        }
    }
</script>

<style>
    .listdata {
        margin: 10px 20px 0 10px;
    }

    .listdata navigator {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #EBEBEB;
        padding: 0 0 10px 0;
    }

    .listdata .conents {
        width: 540rpx;
    }

    .listdata .conents .saymng {
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        line-height: 20px;
        color: #333333;
        width: ;
    }

    .listdata .conents .dates {
        font-size: 12px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        line-height: 20px;
        color: #ADB0BB;
        margin: 20px 0 0 0;
    }

    .listdata .nocimg {
        width: 70px;
        height: 70px;
        border-radius: 6px;
    }
</style>
